package com.train.mgr.modules.biz.dto.response;

import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("上传文件返回对象模型")
public class FileDto {
    @ApiModelProperty(name = "id", value = "fileUpload对象id")
    private String id;
    @ApiModelProperty(name = "filePath", value = "访问地址")
    private String filePath;
    @ApiModelProperty(name = "fileSize", value = "文件大小")
    private double fileSize;
    @ApiModelProperty(name = "fileType", value = "文件分类")
    private String fileType;
    @ApiModelProperty(name = "fileExtension", value = "文件后缀名")
    private String fileExtension;
    @ApiModelProperty(name = "fileName", value = "文件名称")
    private String fileName;

    @JsonIgnore
    private Long fileUploadTime;

    @JsonIgnore
    private Long fileZipTime;

    @JsonIgnore
    private Long fileDownLoadTime;

    @JsonIgnore
    private String fileDesc;

    @JsonIgnore
    private FileDesc desc;

    @JsonIgnore
    private String filePdfPath;

    public void setFileDesc(String fileDesc) {
        this.fileDesc = fileDesc;
        this.desc = JSONUtil.toBean(fileDesc, FileDesc.class);
    }
}
